package model.juliStaff.arboles;
/*

    This file is part of Logica-Logike.

    Logica-Logike is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation version 3 of the License.

    Logica-Logike is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Logica-Logike.  If not, see <http://www.gnu.org/licenses/>.

 */
/**
 * Date: Sep 5, 2009
 * Time: 8:25:53 PM
 *
 * @author Maria Julia Racca;
 */

public class LogicalTree<E> implements LogicalTreeInterace<E> {

    private DoubleNode<E> root;
    TreeType type;

    public LogicalTree() {
        this.root = new DoubleNode<E>(null, null, null);
    }

    public LogicalTree(E value) {
        this.root = new DoubleNode<E>(null, null, value);
    }

    @Override
    public LogicalTreeInterace<E> getLeft() {

        LogicalTree<E> tree = new LogicalTree<E>();
        tree.root = root.getLeft();
        return tree;
    }

    @Override
    public LogicalTreeInterace<E> getRight() {

        LogicalTree<E> tree = new LogicalTree<E>();
        tree.root = root.getRight();
        return tree;
    }

    @Override
    public E getValue() {
        return root.getValue();
    }

    @Override
    public boolean isEmpty() {
        return root == null;
    }

    public TreeType getType() {
        return type;
    }

    public void setType(TreeType type) {
        this.type = type;
    }

    @Override
    public void setValue(E value) {
        root.setValue(value);

    }

    @Override
    public void setLeft(LogicalTreeInterace<E> tree) {
        // TODO Auto-generated method stub

    }

    @Override
    public void setRight(LogicalTreeInterace<E> tree) {
        // TODO Auto-generated method stub

    }

}
